import React, { useEffect, useState } from 'react'
import { Table, Tag, Modal, Popover, Button, Switch } from 'antd';
import axios from 'axios'
export default function Rightlist() {
  const [dataSource, setDataSource] = useState([])
  useEffect(()=>{
    axios.get('http://localhost:8000/roles').then(res => {
      // this.setState({
      //   dataSource: res.data
      // })
      console.log(res)
      setDataSource(res.data)
    })
  },[])
  const columns=[
    {
      title: 'ID',
      dataIndex: 'id',
    },
    {
      title: '权限名称',
      dataIndex: 'roleName',
    },
  ]
  return (
    <div>
      <Table dataSource={dataSource} columns={columns} pagination={{ pageSize: 5 }} />;
    </div>
  )
}
